3.214 \(\int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx\)

Optimal. Leaf size=83 \[ \frac {\tan (e+f x)}{f (c-d) (a \sec (e+f x)+a)}-\frac {2 d \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{a f (c-d)^{3/2} \sqrt {c+d}} \]

[Out]

-2*d*arctanh((c-d)^(1/2)*tan(1/2*e+1/2*f*x)/(c+d)^(1/2))/a/(c-d)^(3/2)/f/(c+d)^(1/2)+tan(f*x+e)/(c-d)/f/(a+a*s
ec(f*x+e))

________________________________________________________________________________________

Rubi [A]  time = 0.16, antiderivative size = 134, normalized size of antiderivative = 1.61, number of steps used = 4, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {3987, 96, 93, 205} \[ \frac {2 d \tan (e+f x) \tan ^{-1}\left (\frac {\sqrt {c+d} \sqrt {a \sec (e+f x)+a}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right )}{f (c-d)^{3/2} \sqrt {c+d} \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {\tan (e+f x)}{f (c-d) (a \sec (e+f x)+a)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]/((a + a*Sec[e + f*x])*(c + d*Sec[e + f*x])),x]

[Out]

Tan[e + f*x]/((c - d)*f*(a + a*Sec[e + f*x])) + (2*d*ArcTan[(Sqrt[c + d]*Sqrt[a + a*Sec[e + f*x]])/(Sqrt[c - d
]*Sqrt[a - a*Sec[e + f*x]])]*Tan[e + f*x])/((c - d)^(3/2)*Sqrt[c + d]*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Se
c[e + f*x]])

Rule 93

Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_)), x_Symbol] :> With[{q = Denomin
ator[m]}, Dist[q, Subst[Int[x^(q*(m + 1) - 1)/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^
(1/q)], x]] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && LtQ[-1, m, 0] && SimplerQ[
a + b*x, c + d*x]

Rule 96

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*(a +
 b*x)^(m + 1)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/((m + 1)*(b*c - a*d)*(b*e - a*f)), x] + Dist[(a*d*f*(m + 1)
 + b*c*f*(n + 1) + b*d*e*(p + 1))/((m + 1)*(b*c - a*d)*(b*e - a*f)), Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*
x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && EqQ[Simplify[m + n + p + 3], 0] && (LtQ[m, -1] || Sum
SimplerQ[m, 1])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 3987

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[(a^2*g*Cot[e + f*x])/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x
]]), Subst[Int[((g*x)^(p - 1)*(a + b*x)^(m - 1/2)*(c + d*x)^n)/Sqrt[a - b*x], x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rubi steps

\begin {align*} \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx &=-\frac {\left (a^2 \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {a-a x} (a+a x)^{3/2} (c+d x)} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x))}+\frac {(a d \tan (e+f x)) \operatorname {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{(c-d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x))}+\frac {(2 a d \tan (e+f x)) \operatorname {Subst}\left (\int \frac {1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac {\sqrt {a+a \sec (e+f x)}}{\sqrt {a-a \sec (e+f x)}}\right )}{(c-d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x))}+\frac {2 d \tan ^{-1}\left (\frac {\sqrt {c+d} \sqrt {a+a \sec (e+f x)}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right ) \tan (e+f x)}{(c-d)^{3/2} \sqrt {c+d} f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.67, size = 160, normalized size = 1.93 \[ \frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) \left (\sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )+\frac {2 d (\sin (e)+i \cos (e)) \cos \left (\frac {1}{2} (e+f x)\right ) \tan ^{-1}\left (\frac {(\sin (e)+i \cos (e)) \left (\tan \left (\frac {f x}{2}\right ) (c \cos (e)-d)+c \sin (e)\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right )}{a f (c-d) (\cos (e+f x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]/((a + a*Sec[e + f*x])*(c + d*Sec[e + f*x])),x]

[Out]

(2*Cos[(e + f*x)/2]*((2*d*ArcTan[((I*Cos[e] + Sin[e])*(c*Sin[e] + (-d + c*Cos[e])*Tan[(f*x)/2]))/(Sqrt[c^2 - d
^2]*Sqrt[(Cos[e] - I*Sin[e])^2])]*Cos[(e + f*x)/2]*(I*Cos[e] + Sin[e]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[
e])^2]) + Sec[e/2]*Sin[(f*x)/2]))/(a*(c - d)*f*(1 + Cos[e + f*x]))

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 353, normalized size = 4.25 \[ \left [-\frac {\sqrt {c^{2} - d^{2}} {\left (d \cos \left (f x + e\right ) + d\right )} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt {c^{2} - d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) - 2 \, {\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \cos \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f\right )}}, -\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cos \left (f x + e\right ) + d\right )} \arctan \left (-\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )}}{{\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}\right ) - {\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}{{\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \cos \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="fricas")

[Out]

[-1/2*(sqrt(c^2 - d^2)*(d*cos(f*x + e) + d)*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^
2 - d^2)*(d*cos(f*x + e) + c)*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) - 2
*(c^2 - d^2)*sin(f*x + e))/((a*c^3 - a*c^2*d - a*c*d^2 + a*d^3)*f*cos(f*x + e) + (a*c^3 - a*c^2*d - a*c*d^2 +
a*d^3)*f), -(sqrt(-c^2 + d^2)*(d*cos(f*x + e) + d)*arctan(-sqrt(-c^2 + d^2)*(d*cos(f*x + e) + c)/((c^2 - d^2)*
sin(f*x + e))) - (c^2 - d^2)*sin(f*x + e))/((a*c^3 - a*c^2*d - a*c*d^2 + a*d^3)*f*cos(f*x + e) + (a*c^3 - a*c^
2*d - a*c*d^2 + a*d^3)*f)]

________________________________________________________________________________________

giac [A]  time = 0.52, size = 114, normalized size = 1.37 \[ \frac {\frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )} d}{{\left (a c - a d\right )} \sqrt {-c^{2} + d^{2}}} + \frac {\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a c - a d}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="giac")

[Out]

(2*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*tan(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))
/sqrt(-c^2 + d^2)))*d/((a*c - a*d)*sqrt(-c^2 + d^2)) + tan(1/2*f*x + 1/2*e)/(a*c - a*d))/f

________________________________________________________________________________________

maple [A]  time = 0.69, size = 74, normalized size = 0.89 \[ \frac {\frac {\tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{c -d}-\frac {2 d \arctanh \left (\frac {\tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \left (c -d \right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c -d \right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}}{f a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x)

[Out]

1/f/a*(1/(c-d)*tan(1/2*e+1/2*f*x)-2*d/(c-d)/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*e+1/2*f*x)*(c-d)/((c+d)*(c-d))
^(1/2)))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?`
 for more details)Is 4*c^2-4*d^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 1.95, size = 110, normalized size = 1.33 \[ \frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{a\,f\,\left (c-d\right )}-\frac {2\,d\,\mathrm {atanh}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c^2-2\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c\,d+\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,d^2}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c+d}\,{\left (c-d\right )}^{3/2}}\right )}{a\,f\,\sqrt {c+d}\,{\left (c-d\right )}^{3/2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(e + f*x)*(a + a/cos(e + f*x))*(c + d/cos(e + f*x))),x)

[Out]

tan(e/2 + (f*x)/2)/(a*f*(c - d)) - (2*d*atanh((c^2*sin(e/2 + (f*x)/2) + d^2*sin(e/2 + (f*x)/2) - 2*c*d*sin(e/2
 + (f*x)/2))/(cos(e/2 + (f*x)/2)*(c + d)^(1/2)*(c - d)^(3/2))))/(a*f*(c + d)^(1/2)*(c - d)^(3/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\sec {\left (e + f x \right )}}{c \sec {\left (e + f x \right )} + c + d \sec ^{2}{\left (e + f x \right )} + d \sec {\left (e + f x \right )}}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e)),x)

[Out]

Integral(sec(e + f*x)/(c*sec(e + f*x) + c + d*sec(e + f*x)**2 + d*sec(e + f*x)), x)/a

________________________________________________________________________________________